<?php


namespace app\mall\model\Goods;



use think\facade\Db;

class GoodsAttrValueModel
{
    /**
     * 数据表名
     * @var string
     */
    protected $name = "goods_attr_value";

    /**
     * 根据条件查询多条数据
     * @param $where
     * @return array
     * @throws
     */
    public static function getGoodsAttrValueWhereMore($where)
    {
        $list = Db::name("goods_attr_value")->where($where)->select()->toArray();
        return $list;
    }


    /**
     * 添加返回ID
     * @param $data
     * @return int
     */
    public static function addGoodsAttrValue($data)
    {
        $id = Db::name('goods_attr_value')->insertGetId($data);
        return $id;
    }

    /**
     * 更新
     * @param $where
     * @param $save
     * @return int
     * @throws
     */
    public static function updateGoodsAttrValueWhere($where,$save)
    {
        $flag = Db::name('goods_attr_value')->where($where)->update($save);
        return $flag;
    }

    /**
     * 删除
     * @param $where
     * @return int
     * @throws
     */
    public static function delGoodsAttrValueWhere($where)
    {
        $flag = Db::name('goods_attr_value')->where($where)->delete();
        return $flag;
    }
}
